l1a: ✅ PASS | l1b: ✅ PASS | l2: ❌ FAIL (not supported)#548
Open
opencode-agent[bot] wants to merge 1 commit into
Open
l1a: ✅ PASS | l1b: ✅ PASS | l2: ❌ FAIL (not supported)#548opencode-agent[bot] wants to merge 1 commit into
opencode-agent[bot] wants to merge 1 commit into
Conversation
Co-authored-by: LSantha <LSantha@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Spec compliance report
L2ByteCodeSupportChecker.visit_castore()explicitly callsnotSupported()Details
l1a Implementation
core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:1344(visit_castore),core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:4143(wastore),core/src/core/org/jnode/vm/x86/compiler/l1a/X86BytecodeVisitor.java:330(checkBounds)Analysis:
val(value),idx(index),ref(arrayref) at lines 4181-4183. Matches JVM spec..., arrayref, index, value → ....checkBounds()at line 330 emitsCMPagainstarrayLengthOffsetafter loadingref. Ifrefis null, the memory access faults or the comparison fails, andinvokeJavaMethod(context.getThrowArrayOutOfBounds())is called. TheThrowArrayOutOfBoundsmethod throwsNullPointerExceptionfor null refs andArrayIndexOutOfBoundsExceptionfor invalid indices.checkBounds()compares array length with index usingJNA(Jump if Not Above, i.e., unsigned ≤), correctly throwingArrayIndexOutOfBoundsExceptionon failure.JvmType.CHAR,valSize = BITS16(line 4157) andscale = 2(line 4158), so only lower 16 bits are stored — matches spec "The int value is truncated to a char".castore. Per JVM spec,ArrayStoreExceptiononly applies to reference array stores (aastore). Primitive array stores (castore,bastore,sastore, etc.) do not throwArrayStoreException.l1b Implementation
core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:1534(visit_castore),core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:5127(wastore),core/src/core/org/jnode/vm/x86/compiler/l1b/X86BytecodeVisitor.java:322(checkBounds)Analysis: Identical implementation to l1a. Same correct operand stack handling, null/bounds checks via
checkBounds(), and 16-bit truncation for char arrays. Same TODO comment at line 5185 is not applicable tocastore.l2 Implementation
core/src/core/org/jnode/vm/x86/compiler/l2/L2ByteCodeSupportChecker.java:99(visit_castore)castoreis explicitly marked as not supported. The L2 compiler will fall back to L1 compilation for methods containing this instruction. No code generation exists inGenericX86CodeGeneratororX86CodeGeneratorforcastore(or any array store instruction:aastore,bastore,sastore,castore,fastore,dastore,lastore,iastore).JVM Spec References
..., arrayref, index, value → ...NullPointerException,ArrayIndexOutOfBoundsExceptionaastoreon reference arrays)Closes #225
opencode session | github run